import Vue from "vue";
import ElementUi from "element-ui";
import "element-ui/packages/theme-chalk/src/index.scss";
import locale from "element-ui/lib/locale/lang/zh-CN";
import App from "./App.vue";
import router from "./router";
import components from "./components";
import globalCom from "@/components/base/index";
import i18n from "@/i18n";
import "normalize.css";
import "@/assets/style/index.scss";

import envConfig from "@/utils/envUtils";
window.$envConfig = envConfig;

import Bus from "@/utils/bus";
Vue.prototype.$bus = Bus;

Vue.config.productionTip = false;

Vue.use(ElementUi, {
  locale,
  size: "medium", // mini
  zIndex: 2000, // 默认值：2000
});
Vue.use(components);
Vue.use(globalCom);

new Vue({
  router,
  i18n,
  render: (h) => h(App),
}).$mount("#app");

// 解决vite vue2 vue devtools不显示的问题
const win = window;

if (process.env.NODE_ENV === "development") {
  if ("__VUE_DEVTOOLS_GLOBAL_HOOK__" in win) {
    win.__VUE_DEVTOOLS_GLOBAL_HOOK__.Vue = App;
  }
}
